"use strict"
/**
 * 重庆市政府采购网爬虫
 *  
 */

var Base = require("./base");
var cq_spider = new Base();
cq_spider.name = "重庆市采购网";
cq_spider.contentType = "json";

cq_spider.getPageUrl = function (pg) {
    return "https://www.cqgp.gov.cn/gwebsite/api/v1/notices/stable?pi=" + pg + "&ps=20";
};

cq_spider.getItems = function (jsonObj) {
    var items = [];
    var data = jsonObj.notices;
    for (var e in data) {
        var item = {};
        item.title = data[e].title;
        item.url = "https://www.cqgp.gov.cn/notices/" + data[e].id;
        item.source = cq_spider.name;
        items.push(item);
    }
    return items;
};

exports = module.exports = cq_spider;